<?php
/**
 * Created by PhpStorm.
 * User: moon
 * Date: 2021/6/8
 * Time: 21:04
 */

namespace app\admin\model;

use app\BaseModel;

class Category extends BaseModel
{
    protected $table = 'sh_category';

    public $rule = [
        'name|分类名称' => 'require',
        'level' => 'require|number|between:1,3',
        'category_id_one' => 'require|>=:0',
        'category_id_two' => 'require|>=:0',
        'status' => 'require|between:1,2|number',

    ];
    public $message = [
        'level.require' => '分类等级异常',
        'level.number' => '分类等级异常',
        'level.between' => '分类等级异常',
        'category_id_one.require' => '一级分类必须选择',
        'category_id_one.>=' => '一级分类选择异常',
        'category_id_two.require' => '二级分类必须选择',
        'category_id_two.>=' => '二级分类选择异常',
        'status.require' => '状态选择异常',
        'status.between' => '状态选择异常',
        'status.number' => '状态选择异常',
    ];
}
